From: Ewan Mellor Date: Mon, 6 Nov 2006 11:36:38 +0000 (+0000) Subject: Catch IOError when using local configuration files, to give better diagnostics. X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=447a08c78932305352b8d00133a3325f8b81a0f0;p=xen.git Catch IOError when using local configuration files, to give better diagnostics. Signed-off-by: Ewan Mellor --- diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index 1bb5171eef..d94356d5c5 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -1200,7 +1200,10 @@ def main(argv): return if type(config) == str: + try: config = sxp.parse(file(config))[0] + except IOError, exn: + raise OptionError("Cannot read file %s: %s" % (config, exn[1])) if opts.vals.dryrun: PrettyPrint.prettyprint(config)